/*
 * Copyright (C) 2015 备胎金服
 * 未经授权允许不得进行拷贝和修改
 *   http://www.btjf.com/
 */
package com.zhangman.framework.implementation;

import android.graphics.Bitmap;
import com.zhangman.framework.Graphics;
import com.zhangman.framework.Image;

/**
 * Created by zhangman on 2016/11/1 14:14.
 * Email: zhangman523@126.com
 */
public class AndroidImage implements Image {
  Bitmap bitmap;
  Graphics.ImageFormat mImageFormat;

  public AndroidImage(Bitmap bitmap, Graphics.ImageFormat imageFormat) {
    this.bitmap = bitmap;
    this.mImageFormat = imageFormat;
  }

  @Override public int getWidth() {
    return bitmap.getWidth();
  }

  @Override public int getHeight() {
    return bitmap.getHeight();
  }

  @Override public Graphics.ImageFormat getFormat() {
    return mImageFormat;
  }

  @Override public void dispose() {
    bitmap.recycle();
  }
}
